{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pdfplumber\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "pdf = pdfplumber.open(R\"data/比赛名单.pdf\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "table = []\n",
    "for i in range(len(pdf.pages)):\n",
    "    page = pdf.pages[i]\n",
    "    table.extend(page.extract_table())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "df=pd.DataFrame(table,columns=(\"学校\",\"项目名称\",\"大类\",\"参赛学生\",\"指导教师\"))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>学校</th>\n",
       "      <th>项目名称</th>\n",
       "      <th>大类</th>\n",
       "      <th>参赛学生</th>\n",
       "      <th>指导教师</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "Empty DataFrame\n",
       "Columns: [学校, 项目名称, 大类, 参赛学生, 指导教师]\n",
       "Index: []"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.loc[df.大类==\"信息可视化\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>学校</th>\n",
       "      <th>项目名称</th>\n",
       "      <th>大类</th>\n",
       "      <th>参赛学生</th>\n",
       "      <th>指导教师</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>甘肃农业大学</td>\n",
       "      <td>基于Matplotlib甘肃农业大学教育数据可视化分析系统</td>\n",
       "      <td>信息可视化设计</td>\n",
       "      <td>徐小韦</td>\n",
       "      <td>陈蕾  雒翠萍</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>51</th>\n",
       "      <td>空军工程大学</td>\n",
       "      <td>党史档案馆</td>\n",
       "      <td>信息可视化设计</td>\n",
       "      <td>李国庆  刘蕴基  王雪倩</td>\n",
       "      <td>高育鹏  王颖</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>67</th>\n",
       "      <td>兰州大学</td>\n",
       "      <td>公立医院改善医疗服务调研分析系统</td>\n",
       "      <td>信息可视化设计</td>\n",
       "      <td>陈锦华  姚敦瀚  薛皓元</td>\n",
       "      <td>高若宇  孟文勃</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>84</th>\n",
       "      <td>兰州理工大学</td>\n",
       "      <td>基于Python的设备排放声信号可视化处理系统</td>\n",
       "      <td>信息可视化设计</td>\n",
       "      <td>崔文爽  张浩  刘霞</td>\n",
       "      <td>李树勋  陈金林</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>98</th>\n",
       "      <td>兰州文理学院</td>\n",
       "      <td>智网云联-基于人工智能的疫情数据可视化</td>\n",
       "      <td>信息可视化设计</td>\n",
       "      <td>张敬尧  雒岁琴  张秀花</td>\n",
       "      <td>马国俊</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>113</th>\n",
       "      <td>陇东学院</td>\n",
       "      <td>智慧招聘数据可视化的设计与实现</td>\n",
       "      <td>信息可视化设计</td>\n",
       "      <td>何自滢  贾静怡  巩明强</td>\n",
       "      <td>杨永锋</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>121</th>\n",
       "      <td>宁夏理工学院</td>\n",
       "      <td>疫情数据分析与可视化系统开发</td>\n",
       "      <td>信息可视化设计</td>\n",
       "      <td>李林垦  蒋闯闯  马国栋</td>\n",
       "      <td>谢涛  尚杨</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>139</th>\n",
       "      <td>青海大学</td>\n",
       "      <td>说文解字</td>\n",
       "      <td>信息可视化设计</td>\n",
       "      <td>张艺超  梅青云  李晓康</td>\n",
       "      <td>杨培  刘晓静</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>151</th>\n",
       "      <td>陕西国际商贸学院</td>\n",
       "      <td>考研大数据分析平台</td>\n",
       "      <td>信息可视化设计</td>\n",
       "      <td>王一博  陈业林  崔行</td>\n",
       "      <td>滕文  程瑶</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>164</th>\n",
       "      <td>陕西科技大学</td>\n",
       "      <td>梦回牧野——以弘扬汉字文化为主题的疗愈景观信息可视化设计</td>\n",
       "      <td>信息可视化设计</td>\n",
       "      <td>刘磊  梁磊  陶柯伊</td>\n",
       "      <td>张伟迪  李琰君</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>165</th>\n",
       "      <td>陕西科技大学</td>\n",
       "      <td>濒危鸟类保护中心</td>\n",
       "      <td>信息可视化设计</td>\n",
       "      <td>申静雯  任佳荟</td>\n",
       "      <td>关瑛  魏小红</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>191</th>\n",
       "      <td>陕西师范大学</td>\n",
       "      <td>信息可视化技术在湿地信息化中的应用</td>\n",
       "      <td>信息可视化设计</td>\n",
       "      <td>周舒桐  扎西平措  杨雪</td>\n",
       "      <td>路纲</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>225</th>\n",
       "      <td>武警工程大学</td>\n",
       "      <td>新训学员训练伤数据可视化</td>\n",
       "      <td>信息可视化设计</td>\n",
       "      <td>冯攀</td>\n",
       "      <td>李曼</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>226</th>\n",
       "      <td>武警工程大学</td>\n",
       "      <td>心理疾病可视化</td>\n",
       "      <td>信息可视化设计</td>\n",
       "      <td>王玺翔  丁宇宁  张书宁</td>\n",
       "      <td>张英男</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>227</th>\n",
       "      <td>武警工程大学</td>\n",
       "      <td>疫情大数据信息统计</td>\n",
       "      <td>信息可视化设计</td>\n",
       "      <td>郑浩然  李超然</td>\n",
       "      <td>王甲琛</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>242</th>\n",
       "      <td>西安电子科技大学</td>\n",
       "      <td>疫览无遗——基于SEIR优化模型的疫情决策辅助平台</td>\n",
       "      <td>信息可视化设计</td>\n",
       "      <td>李敬城  郑杰文  王宠</td>\n",
       "      <td>张弘</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>243</th>\n",
       "      <td>西安电子科技大学</td>\n",
       "      <td>永不停息的墨川</td>\n",
       "      <td>信息可视化设计</td>\n",
       "      <td>梁烨  戎晋新  陆兢伟</td>\n",
       "      <td>杨西惠  张爱梅</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>284</th>\n",
       "      <td>西安建筑科技大学</td>\n",
       "      <td>研选——考研数据分析与可视化</td>\n",
       "      <td>信息可视化设计</td>\n",
       "      <td>张日正  郭阳  李思凡</td>\n",
       "      <td>边根庆  张翔</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>285</th>\n",
       "      <td>西安建筑科技大学</td>\n",
       "      <td>《熬夜调查局》</td>\n",
       "      <td>信息可视化设计</td>\n",
       "      <td>黄艳  贺诗屿  唐杰</td>\n",
       "      <td>毛力</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>286</th>\n",
       "      <td>西安建筑科技大学</td>\n",
       "      <td>基于晋祠古建的信息可视化设计</td>\n",
       "      <td>信息可视化设计</td>\n",
       "      <td>王思霖  于欣可  汪洋</td>\n",
       "      <td>边根庆  肖福刚</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>319</th>\n",
       "      <td>西安明德理工学院</td>\n",
       "      <td>汉字魂</td>\n",
       "      <td>信息可视化设计</td>\n",
       "      <td>韩伶昕  马珊珊</td>\n",
       "      <td>李雪  于泳</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>320</th>\n",
       "      <td>西安明德理工学院</td>\n",
       "      <td>《抑郁》</td>\n",
       "      <td>信息可视化设计</td>\n",
       "      <td>张智一</td>\n",
       "      <td>于泳  舒粉利</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>321</th>\n",
       "      <td>西安明德理工学院</td>\n",
       "      <td>《校园图书馆》</td>\n",
       "      <td>信息可视化设计</td>\n",
       "      <td>刘若男</td>\n",
       "      <td>董健  舒粉利</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>333</th>\n",
       "      <td>西安培华学院</td>\n",
       "      <td>基于layUI+echarts的仓库数据可视化管理</td>\n",
       "      <td>信息可视化设计</td>\n",
       "      <td>翁天雄  卢木权  卓隆凯</td>\n",
       "      <td>黄玉蕾  林青</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>334</th>\n",
       "      <td>西安培华学院</td>\n",
       "      <td>基于数据挖掘与分析的大学生就业推荐系统</td>\n",
       "      <td>信息可视化设计</td>\n",
       "      <td>张富帅  吕德明  罗剑</td>\n",
       "      <td>刘丽景  严亚宁</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>361</th>\n",
       "      <td>西安文理学院</td>\n",
       "      <td>基于Unity的3D智慧校园信息可视化</td>\n",
       "      <td>信息可视化设计</td>\n",
       "      <td>蒋少杰  聂光军  赵懿倩</td>\n",
       "      <td>柯程虎  田莘</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>362</th>\n",
       "      <td>西安文理学院</td>\n",
       "      <td>《健康生活·践于行》系列信息图设计</td>\n",
       "      <td>信息可视化设计</td>\n",
       "      <td>康晓杰  韩子鑫  尚芷乐</td>\n",
       "      <td>黄婷</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>379</th>\n",
       "      <td>西安邮电大学</td>\n",
       "      <td>基于网络爬虫和PyECharts的GitHub仓库数据可视化平台</td>\n",
       "      <td>信息可视化设计</td>\n",
       "      <td>陈春晗  李诗怡  王睿笙</td>\n",
       "      <td>孙家泽  王博</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>397</th>\n",
       "      <td>西北大学</td>\n",
       "      <td>传统木板年画的数字化图解</td>\n",
       "      <td>信息可视化设计</td>\n",
       "      <td>仲翛珣</td>\n",
       "      <td>王江鹏</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>398</th>\n",
       "      <td>西北大学</td>\n",
       "      <td>“九州纪”——汉地九州元素交互信息设计</td>\n",
       "      <td>信息可视化设计</td>\n",
       "      <td>张雯玉  曹泓林  汪卓</td>\n",
       "      <td>张思望</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>399</th>\n",
       "      <td>西北大学</td>\n",
       "      <td>“京心”——基于OpenCV与Unity Shader的京剧脸谱创意展示平台</td>\n",
       "      <td>信息可视化设计</td>\n",
       "      <td>孙昕  尹庄  张思麒</td>\n",
       "      <td>王小凤</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>421</th>\n",
       "      <td>西北民族大学</td>\n",
       "      <td>《马家窑文化彩陶信息可视化设计》</td>\n",
       "      <td>信息可视化设计</td>\n",
       "      <td>张金星  赵紫琪</td>\n",
       "      <td>李文丽  李君利</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>422</th>\n",
       "      <td>西北民族大学</td>\n",
       "      <td>《兰州野生动物园信息可视化》</td>\n",
       "      <td>信息可视化设计</td>\n",
       "      <td>王艺霏  乌日娜  陈强</td>\n",
       "      <td>李文丽  李瑾</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>437</th>\n",
       "      <td>西北农林科技大学</td>\n",
       "      <td>能源可视化与抽水蓄能电站选址辅助决策平台</td>\n",
       "      <td>信息可视化设计</td>\n",
       "      <td>宋云丽    党文婷  杨雨鑫</td>\n",
       "      <td>何海龙  张廷龙</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>438</th>\n",
       "      <td>西北农林科技大学</td>\n",
       "      <td>城市公共教育服务设施选址优化研究——以陕西省杨凌示范区小学选址为例</td>\n",
       "      <td>信息可视化设计</td>\n",
       "      <td>童安  刘宇意  唐婵</td>\n",
       "      <td>付鑫</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>455</th>\n",
       "      <td>西藏民族大学</td>\n",
       "      <td>基于民大学子综合素质测评的数据可视化</td>\n",
       "      <td>信息可视化设计</td>\n",
       "      <td>陈怡霏  董鑫源</td>\n",
       "      <td>石方夏</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>469</th>\n",
       "      <td>西京学院</td>\n",
       "      <td>《西安回放》</td>\n",
       "      <td>信息可视化设计</td>\n",
       "      <td>张依然  杨晓涵</td>\n",
       "      <td>汤光翊</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>484</th>\n",
       "      <td>延安大学</td>\n",
       "      <td>污染物可视化大屏</td>\n",
       "      <td>信息可视化设计</td>\n",
       "      <td>马帅  袁震  冯依嘉</td>\n",
       "      <td>刘瑶</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>496</th>\n",
       "      <td>长安大学</td>\n",
       "      <td>体育新形态——国内电子竞技行业发展研究</td>\n",
       "      <td>信息可视化设计</td>\n",
       "      <td>潘萌萌  杨金蓉</td>\n",
       "      <td>吕进  卢江</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "           学校                                    项目名称       大类  \\\n",
       "20     甘肃农业大学           基于Matplotlib甘肃农业大学教育数据可视化分析系统  信息可视化设计   \n",
       "51     空军工程大学                                   党史档案馆  信息可视化设计   \n",
       "67       兰州大学                        公立医院改善医疗服务调研分析系统  信息可视化设计   \n",
       "84     兰州理工大学                 基于Python的设备排放声信号可视化处理系统  信息可视化设计   \n",
       "98     兰州文理学院                     智网云联-基于人工智能的疫情数据可视化  信息可视化设计   \n",
       "113      陇东学院                         智慧招聘数据可视化的设计与实现  信息可视化设计   \n",
       "121    宁夏理工学院                          疫情数据分析与可视化系统开发  信息可视化设计   \n",
       "139      青海大学                                    说文解字  信息可视化设计   \n",
       "151  陕西国际商贸学院                               考研大数据分析平台  信息可视化设计   \n",
       "164    陕西科技大学            梦回牧野——以弘扬汉字文化为主题的疗愈景观信息可视化设计  信息可视化设计   \n",
       "165    陕西科技大学                                濒危鸟类保护中心  信息可视化设计   \n",
       "191    陕西师范大学                       信息可视化技术在湿地信息化中的应用  信息可视化设计   \n",
       "225    武警工程大学                            新训学员训练伤数据可视化  信息可视化设计   \n",
       "226    武警工程大学                                 心理疾病可视化  信息可视化设计   \n",
       "227    武警工程大学                               疫情大数据信息统计  信息可视化设计   \n",
       "242  西安电子科技大学               疫览无遗——基于SEIR优化模型的疫情决策辅助平台  信息可视化设计   \n",
       "243  西安电子科技大学                                 永不停息的墨川  信息可视化设计   \n",
       "284  西安建筑科技大学                          研选——考研数据分析与可视化  信息可视化设计   \n",
       "285  西安建筑科技大学                                 《熬夜调查局》  信息可视化设计   \n",
       "286  西安建筑科技大学                          基于晋祠古建的信息可视化设计  信息可视化设计   \n",
       "319  西安明德理工学院                                     汉字魂  信息可视化设计   \n",
       "320  西安明德理工学院                                    《抑郁》  信息可视化设计   \n",
       "321  西安明德理工学院                                 《校园图书馆》  信息可视化设计   \n",
       "333    西安培华学院               基于layUI+echarts的仓库数据可视化管理  信息可视化设计   \n",
       "334    西安培华学院                     基于数据挖掘与分析的大学生就业推荐系统  信息可视化设计   \n",
       "361    西安文理学院                     基于Unity的3D智慧校园信息可视化  信息可视化设计   \n",
       "362    西安文理学院                       《健康生活·践于行》系列信息图设计  信息可视化设计   \n",
       "379    西安邮电大学        基于网络爬虫和PyECharts的GitHub仓库数据可视化平台  信息可视化设计   \n",
       "397      西北大学                            传统木板年画的数字化图解  信息可视化设计   \n",
       "398      西北大学                     “九州纪”——汉地九州元素交互信息设计  信息可视化设计   \n",
       "399      西北大学  “京心”——基于OpenCV与Unity Shader的京剧脸谱创意展示平台  信息可视化设计   \n",
       "421    西北民族大学                        《马家窑文化彩陶信息可视化设计》  信息可视化设计   \n",
       "422    西北民族大学                          《兰州野生动物园信息可视化》  信息可视化设计   \n",
       "437  西北农林科技大学                    能源可视化与抽水蓄能电站选址辅助决策平台  信息可视化设计   \n",
       "438  西北农林科技大学       城市公共教育服务设施选址优化研究——以陕西省杨凌示范区小学选址为例  信息可视化设计   \n",
       "455    西藏民族大学                      基于民大学子综合素质测评的数据可视化  信息可视化设计   \n",
       "469      西京学院                                  《西安回放》  信息可视化设计   \n",
       "484      延安大学                                污染物可视化大屏  信息可视化设计   \n",
       "496      长安大学                     体育新形态——国内电子竞技行业发展研究  信息可视化设计   \n",
       "\n",
       "                参赛学生      指导教师  \n",
       "20               徐小韦   陈蕾  雒翠萍  \n",
       "51     李国庆  刘蕴基  王雪倩   高育鹏  王颖  \n",
       "67     陈锦华  姚敦瀚  薛皓元  高若宇  孟文勃  \n",
       "84       崔文爽  张浩  刘霞  李树勋  陈金林  \n",
       "98     张敬尧  雒岁琴  张秀花       马国俊  \n",
       "113    何自滢  贾静怡  巩明强       杨永锋  \n",
       "121    李林垦  蒋闯闯  马国栋    谢涛  尚杨  \n",
       "139    张艺超  梅青云  李晓康   杨培  刘晓静  \n",
       "151     王一博  陈业林  崔行    滕文  程瑶  \n",
       "164      刘磊  梁磊  陶柯伊  张伟迪  李琰君  \n",
       "165         申静雯  任佳荟   关瑛  魏小红  \n",
       "191    周舒桐  扎西平措  杨雪        路纲  \n",
       "225               冯攀        李曼  \n",
       "226    王玺翔  丁宇宁  张书宁       张英男  \n",
       "227         郑浩然  李超然       王甲琛  \n",
       "242     李敬城  郑杰文  王宠        张弘  \n",
       "243     梁烨  戎晋新  陆兢伟  杨西惠  张爱梅  \n",
       "284     张日正  郭阳  李思凡   边根庆  张翔  \n",
       "285      黄艳  贺诗屿  唐杰        毛力  \n",
       "286     王思霖  于欣可  汪洋  边根庆  肖福刚  \n",
       "319         韩伶昕  马珊珊    李雪  于泳  \n",
       "320              张智一   于泳  舒粉利  \n",
       "321              刘若男   董健  舒粉利  \n",
       "333    翁天雄  卢木权  卓隆凯   黄玉蕾  林青  \n",
       "334     张富帅  吕德明  罗剑  刘丽景  严亚宁  \n",
       "361    蒋少杰  聂光军  赵懿倩   柯程虎  田莘  \n",
       "362    康晓杰  韩子鑫  尚芷乐        黄婷  \n",
       "379    陈春晗  李诗怡  王睿笙   孙家泽  王博  \n",
       "397              仲翛珣       王江鹏  \n",
       "398     张雯玉  曹泓林  汪卓       张思望  \n",
       "399      孙昕  尹庄  张思麒       王小凤  \n",
       "421         张金星  赵紫琪  李文丽  李君利  \n",
       "422     王艺霏  乌日娜  陈强   李文丽  李瑾  \n",
       "437  宋云丽    党文婷  杨雨鑫  何海龙  张廷龙  \n",
       "438      童安  刘宇意  唐婵        付鑫  \n",
       "455         陈怡霏  董鑫源       石方夏  \n",
       "469         张依然  杨晓涵       汤光翊  \n",
       "484      马帅  袁震  冯依嘉        刘瑶  \n",
       "496         潘萌萌  杨金蓉    吕进  卢江  "
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "筛选设计=df.大类==\"信息可视化设计\"\n",
    "df.loc[筛选设计]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_works_amount_by_school(df, school:str)->int:return df.query(F'学校==\"{school}\"').shape[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "def condition(df):\n",
    "    筛选条件 =df.大类==\"信息可视化\"\n",
    "    return 筛选条件"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>学校</th>\n",
       "      <th>项目名称</th>\n",
       "      <th>大类</th>\n",
       "      <th>参赛学生</th>\n",
       "      <th>指导教师</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "Empty DataFrame\n",
       "Columns: [学校, 项目名称, 大类, 参赛学生, 指导教师]\n",
       "Index: []"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.loc[condition(df)]"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3.8.10 64-bit",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.10"
  },
  "orig_nbformat": 4,
  "vscode": {
   "interpreter": {
    "hash": "e5b51f9075b4cc1ea8d9810577a26807122690438b3a6e6e05129a402faed2ba"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
